package com.share.shareplatform.common.state;

public enum GoodsKind {

    NEW("最新产品","goods.newList"),
    HOT("热门产品","goods.hotList"),
    RECOMMEND("推荐产品","goods.recommendList");

    private String kind;
    private String redisName;


    GoodsKind(String kind,String redisName){
        this.kind=kind;
        this.redisName=redisName;
    }

    public String getKind() {
        return kind;
    }

    public String getRedisName() {
        return redisName;
    }

    public static String searchRedisName(String kind){
        for(GoodsKind goodsKind:GoodsKind.values()){
            if(goodsKind.getKind().equals(kind)){
                return goodsKind.getRedisName();
            }
        }
        return null;
    }

    public static boolean search(String kind){
        for(GoodsKind goodsKind:GoodsKind.values()){
            if(goodsKind.getKind().equals(kind)){
                return true;
            }
        }
        return false;
    }

}
